<div class="lian_fei chantu layui-hide">
    <div class="men">
        <div class="xiaotit">进项票分析</div>
        <div class="float-l wd50">
            <div class="float-l wd50">
                <div class="fw700" style="padding-bottom: 10px">扣收费用构成</div>
                <div class="chart" id="lian_chart_koufeigou" style="height: 200px"></div>
            </div>
            <div class="float-l wd50" style="padding-top: 80px">
                <div class="float-l fangding" style="padding-left: 20px;padding-top: 5px;">
                    <span class="fanglan tuclr1"></span><span style="margin-left: 20px">扣收管理费：<span id="lian_fei_kou_guanfee">0</span></span>
                </div><div class="clear"></div>
                <div class="float-l fangding" style="padding-left: 20px;padding-top: 5px;">
                    <span class="fanglan tuclr2"></span><span style="margin-left: 20px">扣收税费：<span id="lian_fei_kou_shuifee">0</span></span>
                </div><div class="clear"></div>
                <div class="float-l fangding" style="padding-left: 20px;padding-top: 5px;">
                    <span class="fanglan tuclr3"></span><span style="margin-left: 20px">其他扣收：<span id="lian_fei_kou_qifee">0</span></span>
                </div>
            </div>
            <div class="clear"></div>
        </div>
        <div class="fen1 float-l wd50">
            <div style="margin: 0 auto">
                <div class="ffmg" style="margin: 0 auto;width: 200px">
                    <div class="fftt1 fw700" style="padding-top: 20px">累计扣收</div>
                    <div class="fftt2 fw700"><span id="lian_fei_kou_allfee">0</span></div>
                    <div class="fftt3">已扣收管理费+已扣收税费+其他扣收</div>
                </div>
            </div>
        </div>
        <div class="clear" style="padding-top: 30px"></div>
    </div>

    <div class="xiaoxian"></div>
    <div class="men">
        <div class="xiaotit">应扣分析</div>
        <div class="fen2 float-l wd50">
            <div>
                <span class="float-l" style="padding-bottom: 5px;font-weight: 700;padding-top: 12px">管理费：</span>
                <span class="float-r" style="display: inline-block;width: 280px">
                    <span class="fw700">待扣收管理费：</span>
                    <span class="fw700" id="lian_fei_dai_guanfee" style="font-size: 26px">0</span>
                    <br>
                    <span>应计管理费-已扣收管理费</span>
                </span>

            </div>
            <div class="clear"></div>
            <div class="float-l wd50">
                <div class="chart" id="lian_chart_feiguanfee" style="height: 200px"></div>
            </div>
            <div class="float-l wd50" style="padding-top: 40px">
                <div class="float-r fangding" style="padding-left: 20px;padding-top: 5px;display: inline-block;width: 280px">
                    <span class="fanglan tuclr4"></span><span style="margin-left: 20px">应计管理费：<span id="lian_fei_lian_guanfee">0</span></span>
                </div> <div class="clear"></div>
                <div class="float-r fangding" style="padding-left: 20px;padding-top: 5px;display: inline-block;width: 280px">
                    <span class="fanglan tuclr5"></span><span style="margin-left: 20px">已扣收管理费：<span id="lian_fei_kou_guanfee2">0</span></span>
                </div>
            </div>
            <div class="clear"></div>
        </div>
        <div class="fen2 float-l wd50">
            <div>
                <span class="float-l" style="padding-bottom: 5px;font-weight: 700;padding-top: 12px">税费：</span>
                <span class="float-r" style="display: inline-block;width: 280px">
                    <span class="fw700">待扣收税费：</span>
                    <span class="fw700" id="lian_fei_dai_shuifee" style="font-size: 26px">0</span>
                    <br>
                    <span>应计税费-已扣收税费</span>
                </span>

            </div>
            <div class="clear"></div>
            <div class="float-l wd50">
                <div class="chart" id="lian_chart_feishuifei" style="height: 200px"></div>
            </div>
            <div class="float-l wd50" style="padding-top: 40px">
                <div class="float-r fangding" style="padding-left: 20px;padding-top: 5px;display: inline-block;width: 280px">
                    <span class="fanglan tuclr6"></span><span style="margin-left: 20px">应计税费：<span id="lian_fei_lian_shuifee">0</span></span>
                </div> <div class="clear"></div>
                <div class="float-r fangding" style="padding-left: 20px;padding-top: 5px;display: inline-block;width: 280px">
                    <span class="fanglan tuclr7"></span><span style="margin-left: 20px">已扣收税费：<span id="lian_fei_kou_shuifee2">0</span></span>
                </div>
            </div>
            <div class="clear"></div>
        </div>
        <div class="clear" style="padding-top: 30px"></div>
    </div>
</div>
<script>


    function func_lian_fei() {
        layui.use(['laytp', 'form', 'element'], function() {
            var form = layui.form, layer = layui.layer, element = layui.element;
            facade.ajax({url: ask_engin_cha_lian_fei,data:{enginid:param_enginid}}).done(function(res){
                if (res.code === 2000) {
                    var data = res.data;


                    lian_chart_koufeigou('lian_chart_koufeigou', data);
                    $("#lian_fei_kou_guanfee").text(parseFormatNum(data.kou_guanfee)).addClass('colorlan').click(function () {
                        openNavPage('查看费用扣收信息','lian_koulan/index.php?status=1&feitype_option=xmsr_lyfyhks_glf&enginid='+data.id);
                    });
                    $("#lian_fei_kou_shuifee").text(parseFormatNum(data.kou_shuifee)).addClass('colorlan').click(function () {
                        openNavPage('查看费用扣收信息','lian_koulan/index.php?status=1&feitype_option=xmsr_lyfyhks_sf&enginid='+data.id);
                    });
                    $("#lian_fei_kou_qifee").text(parseFormatNum(data.kou_qifee)).addClass('colorlan').click(function () {
                        openNavPage('查看费用扣收信息','lian_koulan/index.php?status=1&feitype_option=noguannoshui&enginid='+data.id);
                    });
                    $("#lian_fei_kou_allfee").html(parseFormatNum(data.kou_allfee));



                    $("#lian_fei_dai_guanfee").text(parseFormatNum(data.dai_guanfee));
                    $("#lian_fei_lian_guanfee").text(parseFormatNum(data.lian_guanfee));
                    $("#lian_fei_kou_guanfee2").text(parseFormatNum(data.kou_guanfee)).addClass('colorlan').click(function () {
                        openNavPage('查看费用扣收信息','lian_koulan/index.php?status=1&feitype_option=xmsr_lyfyhks_glf&enginid='+data.id);
                    });
                    lian_chart_feiguanfee('lian_chart_feiguanfee', data);


                    $("#lian_fei_dai_shuifee").text(parseFormatNum(data.dai_shuifee));
                    $("#lian_fei_lian_shuifee").text(parseFormatNum(data.lian_shuifee));
                    $("#lian_fei_kou_shuifee2").text(parseFormatNum(data.kou_shuifee)).addClass('colorlan').click(function () {
                        openNavPage('查看费用扣收信息','lian_koulan/index.php?status=1&feitype_option=xmsr_lyfyhks_sf&enginid='+data.id);
                    });
                    lian_chart_feishuifei('lian_chart_feishuifei', data);

                }
            });
        });
    }


    function lian_chart_koufeigou(chat_id, data) {
        var mychat = echarts.init(document.getElementById(chat_id), 'dark');
        mychat.clear();
        option = {
            color: [colors[1], colors[2], colors[3]],
            backgroundColor: '#FFFFFF',
            tooltip: {
                trigger: 'item'
            },
            series: [
                {
                    name: '进项票类型',
                    type: 'pie',
                    radius: ['40%', '80%'],
                    itemStyle: {
                        borderRadius: 10,
                        borderColor: '#fff',
                        borderWidth: 2
                    },
                    data: [
                        { value: data.kou_guanfee, name: '扣收管理费' },
                        { value: data.kou_shuifee, name: '扣收税费' },
                        { value: data.kou_qifee, name: '其他扣收' },
                    ],
                    emphasis: {
                        itemStyle: {
                            shadowBlur: 10,
                            shadowOffsetX: 0,
                            shadowColor: 'rgba(0, 0, 0, 0.5)'
                        }
                    }
                }
            ]
        };
        mychat.setOption(option);
    }
    function lian_chart_feiguanfee(chat_id, data) {
        var mychat = echarts.init(document.getElementById(chat_id), 'dark');
        mychat.clear();

        option = {
            color: [colors[4], colors[5]],
            backgroundColor: '#FFFFFF',
            tooltip: {
                trigger: 'item',
                formatter: '{a} <br/>{b} : {c}'
            },
            grid: {
                top: '1px',
                bottom: '1px',
                left: '1px',
                right: '1px',
                containLabel: true
            },
            series: [
                {
                    name: '管理费',
                    type: 'funnel',
                    left: 1,
                    top: 1,
                    bottom: 30,
                    width: '100%',
                    min: 0,
                    max: 100,
                    minSize: '0%',
                    maxSize: '100%',
                    sort: 'descending',
                    gap: 2,
                    label: {
                        show: true,
                        position: 'inside'
                    },
                    labelLine: {
                        length: 10,
                        lineStyle: {
                            width: 1,
                            type: 'solid'
                        }
                    },
                    itemStyle: {
                        borderColor: '#fff',
                        borderWidth: 1
                    },
                    emphasis: {
                        label: {
                            fontSize: 12
                        }
                    },
                    data: [
                        { value: data.lian_guanfee, name: '应计管理费' },
                        { value: data.kou_guanfee, name: '已扣收管理费' },
                    ]
                }
            ]
        };
        mychat.setOption(option);
    }
    function lian_chart_feishuifei(chat_id, data) {
        var mychat = echarts.init(document.getElementById(chat_id), 'dark');
        mychat.clear();

        option = {
            color: [colors[6], colors[7]],
            backgroundColor: '#FFFFFF',
            tooltip: {
                trigger: 'item',
                formatter: '{a} <br/>{b} : {c}'
            },
            grid: {
                top: '1px',
                bottom: '1px',
                left: '1px',
                right: '1px',
                containLabel: true
            },
            series: [
                {
                    name: '税费',
                    type: 'funnel',
                    left: 1,
                    top: 1,
                    bottom: 30,
                    width: '100%',
                    min: 0,
                    max: 100,
                    minSize: '0%',
                    maxSize: '100%',
                    sort: 'descending',
                    gap: 2,
                    label: {
                        show: true,
                        position: 'inside'
                    },
                    labelLine: {
                        length: 10,
                        lineStyle: {
                            width: 1,
                            type: 'solid'
                        }
                    },
                    itemStyle: {
                        borderColor: '#fff',
                        borderWidth: 1
                    },
                    emphasis: {
                        label: {
                            fontSize: 12
                        }
                    },
                    data: [
                        { value: data.lian_shuifee, name: '应计税费' },
                        { value: data.kou_shuifee, name: '已扣收税费' },
                    ]
                }
            ]
        };
        mychat.setOption(option);
    }
</script>

